package com.itheima.api2;

import java.time.Duration;
import java.time.LocalDate;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Scanner;

public class Demo7 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入您的入职日期:yyyy-MM-dd");
        String time=sc.next();
        time += " 00:00:00";
        DateTimeFormatter dateTimeFormatter=DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime parsetime = LocalDateTime.parse(time,dateTimeFormatter);
        LocalDateTime now=LocalDateTime.now();
        Duration duration=Duration.between(parsetime,now);
        System.out.println(duration.toDays());
    }
}
